package com.novelot.plugin.allinone.tinify;

import com.novelot.plugin.allinone.util.AppExecutors;
import com.tinify.Tinify;

import java.io.IOException;

public class TinifyUtils {
    public static void compress(String pathFrom, String pathTo) {
//        String pathFrom = "/Users/momo/Desktop/tinified/hani_icon_videodialog_close.png";
//        String pathTo = "/Users/momo/Desktop/tinified/hani_icon_videodialog_close_tinified.png";

        AppExecutors.getInstance().diskIO().execute(() -> {
            try {
                Tinify.fromFile(pathFrom).toFile(pathTo);
            } catch (IOException e) {
                e.printStackTrace();
            }
        });
    }
}
